function IsPC () {
  var userAgentInfo = navigator.userAgent
  var Agents = ['Android', 'iPhone',
    'SymbianOS', 'Windows Phone',
    'iPad', 'iPod'
  ]
  var flag = true
  for (var i = 0; i < Agents.length; i++) {
    if (userAgentInfo.indexOf(Agents[i]) != -1) {
      flag = false
      break
    }
  }
  return flag
}

export default {
  methods: {
    onSearch (val) {
      if(val){
        this.$router.push({
          path: '/search',
          query: {
            q: val.replace(/，/g,',')
          }
        })
      }else{
        this.$router.push({
          path: '/'
        })
      }
    }
  },
  created () {
    if (IsPC()) {
      document.documentElement.style.fontSize = '50px'
    }
  }
}
